package chixing.day07.homwork;

public class PartTimeEmployee extends MyEmployee{
    private double hoursWorked;
    private double hourlyRate;

    public PartTimeEmployee(){}

    public PartTimeEmployee(double hoursWorked, double hourlyRate) {
        this.hoursWorked = hoursWorked;
        this.hourlyRate = hourlyRate;
    }

    public PartTimeEmployee(int empNo, String empName, double empBalanceSalary, double hoursWorked, double hourlyRate) {
        super(empNo, empName, empBalanceSalary);
        this.hoursWorked = hoursWorked;
        this.hourlyRate = hourlyRate;
    }

    //calculateSalary
    public double calculateSalary(){
        return this.getEmpBalanceSalary() + hoursWorked * hourlyRate;
    }

    public double getHoursWorked() {
        return hoursWorked;
    }

    public void setHoursWorked(double hoursWorked) {
        this.hoursWorked = hoursWorked;
    }

    public double getHourlyRate() {
        return hourlyRate;
    }

    public void setHourlyRate(double hourlyRate) {
        this.hourlyRate = hourlyRate;
    }

    @Override
    public String toString() {
        return "PartTimeEmployee{" +
                "hoursWorked=" + hoursWorked +
                ", hourlyRate=" + hourlyRate +
                '}';
    }
}
